package com.ywu.data.source.standard.api;

import com.ywu.common.result.CommonResult;
import com.ywu.data.source.standard.dto.YwuDataExecVersionDto;
import com.ywu.data.source.standard.service.YwuDataExecVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuDataExecVersionApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/11/1 13:41
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/data/exec/version")
public class YwuDataExecVersionApi {
    @Autowired
    private YwuDataExecVersionService service;

    /**
    * @Author GroundDemo
    * @Description 查询历史版本列表
    * @Date 11:21 2024/11/20
    * @Param [dataExecVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/query.data.exec.version.info")
    public CommonResult<Object> queryDataExecVersionList(@RequestBody YwuDataExecVersionDto dataExecVersionDto) {
        return service.queryDataExecVersionList(dataExecVersionDto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除草稿数据
    * @Date 11:22 2024/11/20
    * @Param [dataExecVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/delete.data.exec.draft.version.info")
    public CommonResult<Object> deleteDraftVersion(@RequestBody YwuDataExecVersionDto dataExecVersionDto) {
        return service.deleteDraftVersion(dataExecVersionDto);
    }

    /**
    * @Author GroundDemo
    * @Description 回退历史版本
    * @Date 11:22 2024/11/20
    * @Param [thirdExecVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/back.data.exec.version.info")
    public CommonResult<Object> backDataExecVersion(@RequestBody YwuDataExecVersionDto dataExecVersionDto) {
        return service.backDataExecVersion(dataExecVersionDto);
    }

    /**
    * @Author GroundDemo
    * @Description 查询历史版本详情
    * @Date 11:22 2024/11/20
    * @Param [thirdExecVersionDto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/query.data.exec.version.detail.info")
    public CommonResult<Object> queryVersionDetailInfo(@RequestBody YwuDataExecVersionDto dataExecVersionDto) {
        return service.queryVersionDetailInfo(dataExecVersionDto);
    }
}
